package com.bootdo.screen.controller;

import com.bootdo.screen.service.impl.PsDataServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

import static org.springframework.web.bind.annotation.RequestMethod.GET;

@CrossOrigin
@Controller
@RequestMapping(path = "psscreen")
public class PsDataController {

    @Autowired
    private PsDataServiceImpl psDataService;

    @ResponseBody
    @RequestMapping(path = "getPsAreaCount", method = GET)
    public List<Map<String, Object>> getPsAreaCount() {
        return psDataService.getPsAreaCount();
    }

    @ResponseBody
    @RequestMapping(path = "getPsSourceCount", method = GET)
    public List<Map<String,Object>>  getPsSourceCount(){return  psDataService.getPsSourceCount();}

    //采集源top10
    @ResponseBody
    @RequestMapping(path = "getPsSiteTop", method = GET)
    public List<Map<String,Object>>  getPsSiteTop(){return psDataService.getPsSiteTop(); }

    // 采集源列表
    @ResponseBody
    @RequestMapping(path = "getPsSiteList", method = GET)
    public List<String>  getPsSiteList(){ return psDataService.getPsSiteList();}

    //热点媒体源
    @ResponseBody
    @RequestMapping(path = "getPsNewsHot", method = GET)
    public Map<String,Object> getPsNewsHot(){return psDataService.getPsNewsHot();}

    //倾向性判断
    @ResponseBody
    @RequestMapping(path = "getPsNewsHotScore", method = GET)
    public Map<String,Object> getPsNewsHotScore(){ return psDataService.getPsNewsHotScore();}

    //舆情预警
    @ResponseBody
    @RequestMapping(path = "getPsWarning", method = GET)
    public List<Map<String,Object>>  getPsWarning(){
        return psDataService.getPsWarning();
    }

    //舆情主题监测
    @ResponseBody
    @RequestMapping(path = "getPsItemMonitor", method = GET)
    public List<Map<String,Object>>  getPsItemMonitor() { return psDataService.getPsItemMonitor();}

    //舆情用户统计
    @ResponseBody
    @RequestMapping(path = "getUserData", method = GET)
    public   Map<String, Object> getUserData(){ return psDataService.getUserData(); }

}
